package org.yunai.swjg.server.core.util;

import org.yunai.swjg.server.module.player.VocationEnum;

/**
 * 属性Utils
 * User: yunai
 * Date: 13-5-3
 * Time: 下午10:06
 */
public class RolePropertyUtils {

    private RolePropertyUtils() {}

    /**
     * 根据职业+力量/敏捷/智力获得攻击力换算
     *
     * @param vocation     职业
     * @param strength     力量
     * @param dexterity    敏捷
     * @param intelligence 智力
     * @return 攻击力换算
     */
    public static double genAttack(VocationEnum vocation, double strength, double dexterity, double intelligence) {
        final double factor = 3.0d;
        switch (vocation) {
//            case STRENGTH_HERO:
//                return factor * strength;
//            case DEXTERITY_HERO:
//                return factor * dexterity;
//            case INTELLIGENCE_HERO:
//                return factor * intelligence;
            default:
                return 0D;
        }
    }

    /**
     * 根据力量获得Hp换算
     *
     * @param strength 力量
     * @return Hp换算
     */
    public static double genHp(double strength) {
        return strength * 10.0;
    }

    /**
     * 根据敏捷获得防御换算
     *
     * @param dexterity 敏捷
     * @return 防御换算
     */
    public static double genDefense(double dexterity) {
        return dexterity * 5.0;
    }

    /**
     * 根据敏捷获得攻速换算
     *
     * @param dexterity 敏捷
     * @return 攻速换算
     */
    public static double genAttackSpeed(double dexterity) {
        return dexterity * 0.01;
    }

    /**
     * 根据智力获得Mp换算
     *
     * @param intelligence 智力
     * @return Mp换算
     */
    public static double genMp(double intelligence) {
        return intelligence * 10.0;
    }
}
